import models from '../../../models/index.js'

export default defineEventHandler(async () => {
  try {
    const users = await models.User.findAll({
      attributes: ['id', 'email', 'createdAt']
    })
    return { users }
  } catch (error) {
    throw createError({
      statusCode: 500,
      message: '获取用户列表失败'
    })
  }
}) 